﻿//==================================================================
// Copyright (C) 2011 iSun Studio 软件工作室
// 文件名: hrEmployee.cs
// 作 者：代码自动生成
// 日 期：2012/3/5 16:28:55
// 描 述：
// 版 本：1.00
// 修改历史纪录
// 版 本  修改时间      修改人            修改内容
// 1.00             
//==================================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel;
using System.Text;
using Csla;
using lite;
using Csla.Validation;
using Csla.Data;
using System.Data.SqlClient;
using iSun.DAL;
using OpenExpressApp.ORM;

namespace iSun.Entity
{
    /// <summary>
    /// 员工信息主表
    /// </summary>
    [Serializable]
    [Table(Name = "hrEmployee")]
    [iSun.Model.Table("hrEmployee", "ID")]
    public partial class hrEmployee : iSun.Entity.EntityBase
    {

        #region Business Methods 业务方法

        /// <summary>
        /// 编号
        /// </summary>
        private static PropertyInfo<Guid> IDProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<Guid>("ID"));
        [DataObjectField(true, true)]
        [Column, PK]
        public Guid ID
        {
            get { return GetProperty(IDProperty); }
            set { SetProperty(IDProperty, value); }
        }

        /// <summary>
        /// 中文姓名
        /// </summary>
        private static PropertyInfo<string> CNameProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("CName"));
        [Column]
        public string CName
        {
            get { return GetProperty(CNameProperty); }
            set { SetProperty(CNameProperty, value); }
        }
        /// <summary>
        /// 英文名
        /// </summary>
        private static PropertyInfo<string> ENameProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("EName"));
        [Column]
        public string EName
        {
            get { return GetProperty(ENameProperty); }
            set { SetProperty(ENameProperty, value); }
        }
        /// <summary>
        /// 照片地址
        /// </summary>
        private static PropertyInfo<string> PhotoAddressProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("PhotoAddress"));
        [Column]
        public string PhotoAddress
        {
            get { return GetProperty(PhotoAddressProperty); }
            set { SetProperty(PhotoAddressProperty, value); }
        }
        /// <summary>
        /// 身份证号
        /// </summary>
        private static PropertyInfo<string> IDCardNOProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("IDCardNO"));
        [Column]
        public string IDCardNO
        {
            get { return GetProperty(IDCardNOProperty); }
            set { SetProperty(IDCardNOProperty, value); }
        }
        /// <summary>
        /// 护照编号
        /// </summary>
        private static PropertyInfo<string> PassportNOProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("PassportNO"));
        [Column]
        public string PassportNO
        {
            get { return GetProperty(PassportNOProperty); }
            set { SetProperty(PassportNOProperty, value); }
        }
        /// <summary>
        /// 性别
        /// </summary>
        private static PropertyInfo<string> GenderProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("Gender"));
        [Column]
        public string Gender
        {
            get { return GetProperty(GenderProperty); }
            set { SetProperty(GenderProperty, value); }
        }
        /// <summary>
        /// 民族
        /// </summary>
        private static PropertyInfo<string> NationalityProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("Nationality"));
        [Column]
        public string Nationality
        {
            get { return GetProperty(NationalityProperty); }
            set { SetProperty(NationalityProperty, value); }
        }
        /// <summary>
        /// 籍贯
        /// </summary>
        private static PropertyInfo<string> HometownProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("Hometown"));
        [Column]
        public string Hometown
        {
            get { return GetProperty(HometownProperty); }
            set { SetProperty(HometownProperty, value); }
        }
        /// <summary>
        /// 出生日期
        /// </summary>
        private static PropertyInfo<DateTime> BirthDateProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<DateTime>("BirthDate"));
        [Column]
        public DateTime BirthDate
        {
            get { return GetProperty(BirthDateProperty); }
            set { SetProperty(BirthDateProperty, value); }
        }
        /// <summary>
        /// 户口所在地
        /// </summary>
        private static PropertyInfo<string> HouseholdRegistrationProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("HouseholdRegistration"));
        [Column]
        public string HouseholdRegistration
        {
            get { return GetProperty(HouseholdRegistrationProperty); }
            set { SetProperty(HouseholdRegistrationProperty, value); }
        }
        /// <summary>
        /// 人事档案所在地
        /// </summary>
        private static PropertyInfo<string> PersonnelArchivesAreaProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("PersonnelArchivesArea"));
        [Column]
        public string PersonnelArchivesArea
        {
            get { return GetProperty(PersonnelArchivesAreaProperty); }
            set { SetProperty(PersonnelArchivesAreaProperty, value); }
        }
        /// <summary>
        /// 身高
        /// </summary>
        private static PropertyInfo<int> HeightProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<int>("Height"));
        [Column]
        public int Height
        {
            get { return GetProperty(HeightProperty); }
            set { SetProperty(HeightProperty, value); }
        }
        /// <summary>
        /// 体重
        /// </summary>
        private static PropertyInfo<int> WeightProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<int>("Weight"));
        [Column]
        public int Weight
        {
            get { return GetProperty(WeightProperty); }
            set { SetProperty(WeightProperty, value); }
        }
        /// <summary>
        /// 婚姻状况
        /// </summary>
        private static PropertyInfo<string> MaritalStatusProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("MaritalStatus"));
        [Column]
        public string MaritalStatus
        {
            get { return GetProperty(MaritalStatusProperty); }
            set { SetProperty(MaritalStatusProperty, value); }
        }
        /// <summary>
        /// 血型
        /// </summary>
        private static PropertyInfo<string> BloodTypeProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("BloodType"));
        [Column]
        public string BloodType
        {
            get { return GetProperty(BloodTypeProperty); }
            set { SetProperty(BloodTypeProperty, value); }
        }
        /// <summary>
        /// 入职日期
        /// </summary>
        private static PropertyInfo<DateTime> JoinDateProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<DateTime>("JoinDate"));
        [Column]
        public DateTime JoinDate
        {
            get { return GetProperty(JoinDateProperty); }
            set { SetProperty(JoinDateProperty, value); }
        }
        /// <summary>
        /// 社保卡号
        /// </summary>
        private static PropertyInfo<string> SocialInsuranceNOProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("SocialInsuranceNO"));
        [Column]
        public string SocialInsuranceNO
        {
            get { return GetProperty(SocialInsuranceNOProperty); }
            set { SetProperty(SocialInsuranceNOProperty, value); }
        }
        /// <summary>
        /// 住房公积金账号
        /// </summary>
        private static PropertyInfo<string> HouseCardNOProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("HouseCardNO"));
        [Column]
        public string HouseCardNO
        {
            get { return GetProperty(HouseCardNOProperty); }
            set { SetProperty(HouseCardNOProperty, value); }
        }
        /// <summary>
        /// 银行卡号
        /// </summary>
        private static PropertyInfo<string> BankCardNOProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("BankCardNO"));
        [Column]
        public string BankCardNO
        {
            get { return GetProperty(BankCardNOProperty); }
            set { SetProperty(BankCardNOProperty, value); }
        }
        /// <summary>
        /// 紧急联系人电话
        /// </summary>
        private static PropertyInfo<string> UrgencyContactPhoneNOProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("UrgencyContactPhoneNO"));
        [Column]
        public string UrgencyContactPhoneNO
        {
            get { return GetProperty(UrgencyContactPhoneNOProperty); }
            set { SetProperty(UrgencyContactPhoneNOProperty, value); }
        }
        /// <summary>
        /// 与紧急联系人的关系
        /// </summary>
        private static PropertyInfo<string> UrgencyContacRelationProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("UrgencyContacRelation"));
        [Column]
        public string UrgencyContacRelation
        {
            get { return GetProperty(UrgencyContacRelationProperty); }
            set { SetProperty(UrgencyContacRelationProperty, value); }
        }
        /// <summary>
        /// 手机号码
        /// </summary>
        private static PropertyInfo<string> PhoneNoProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("PhoneNo"));
        [Column]
        public string PhoneNo
        {
            get { return GetProperty(PhoneNoProperty); }
            set { SetProperty(PhoneNoProperty, value); }
        }
        /// <summary>
        /// Email
        /// </summary>
        private static PropertyInfo<string> EmailProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("Email"));
        [Column]
        public string Email
        {
            get { return GetProperty(EmailProperty); }
            set { SetProperty(EmailProperty, value); }
        }
        /// <summary>
        /// 居住地址
        /// </summary>
        private static PropertyInfo<string> ResidenceProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("Residence"));
        [Column]
        public string Residence
        {
            get { return GetProperty(ResidenceProperty); }
            set { SetProperty(ResidenceProperty, value); }
        }
        /// <summary>
        /// 兴趣爱好
        /// </summary>
        private static PropertyInfo<string> HabitsProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("Habits"));
        [Column]
        public string Habits
        {
            get { return GetProperty(HabitsProperty); }
            set { SetProperty(HabitsProperty, value); }
        }
        /// <summary>
        /// 招聘来源
        /// </summary>
        private static PropertyInfo<string> ResumeSourceProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("ResumeSource"));
        [Column]
        public string ResumeSource
        {
            get { return GetProperty(ResumeSourceProperty); }
            set { SetProperty(ResumeSourceProperty, value); }
        }
        /// <summary>
        /// 最高学历
        /// </summary>
        private static PropertyInfo<string> TopEducationalLevelProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("TopEducationalLevel"));
        [Column]
        public string TopEducationalLevel
        {
            get { return GetProperty(TopEducationalLevelProperty); }
            set { SetProperty(TopEducationalLevelProperty, value); }
        }
        /// <summary>
        /// 最高学位
        /// </summary>
        private static PropertyInfo<string> TopDegreeProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("TopDegree"));
        [Column]
        public string TopDegree
        {
            get { return GetProperty(TopDegreeProperty); }
            set { SetProperty(TopDegreeProperty, value); }
        }
        /// <summary>
        /// 专长描述
        /// </summary>
        private static PropertyInfo<string> SpecialDescProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("SpecialDesc"));
        [Column]
        public string SpecialDesc
        {
            get { return GetProperty(SpecialDescProperty); }
            set { SetProperty(SpecialDescProperty, value); }
        }
        /// <summary>
        /// 参加工作时间
        /// </summary>
        private static PropertyInfo<DateTime> JoinJobDateProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<DateTime>("JoinJobDate"));
        [Column]
        public DateTime JoinJobDate
        {
            get { return GetProperty(JoinJobDateProperty); }
            set { SetProperty(JoinJobDateProperty, value); }
        }
        /// <summary>
        /// 员工状态
        /// </summary>
        private static PropertyInfo<byte> EmployeeStatusProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<byte>("EmployeeStatus"));
        [Column]
        public byte EmployeeStatus
        {
            get { return GetProperty(EmployeeStatusProperty); }
            set { SetProperty(EmployeeStatusProperty, value); }
        }
        /// <summary>
        /// 员工工号
        /// </summary>
        private static PropertyInfo<string> EmployeeCodeProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<string>("EmployeeCode"));
        [Column]
        public string EmployeeCode
        {
            get { return GetProperty(EmployeeCodeProperty); }
            set { SetProperty(EmployeeCodeProperty, value); }
        }
        /// <summary>
        /// 员工薪资
        /// </summary>
        private static PropertyInfo<int> SalaryProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<int>("Salary"));
        [Column]
        public int Salary
        {
            get { return GetProperty(SalaryProperty); }
            set { SetProperty(SalaryProperty, value); }
        }
        /// <summary>
        /// 职务ID
        /// </summary>
        private static PropertyInfo<Guid> PositionIDProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<Guid>("PositionID"));
        [Column]
        public Guid PositionID
        {
            get { return GetProperty(PositionIDProperty); }
            set { SetProperty(PositionIDProperty, value); }
        }
        /// <summary>
        /// 部门ID
        /// </summary>
        private static PropertyInfo<Guid> DepartmentIDProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<Guid>("DepartmentID"));
        [Column]
        public Guid DepartmentID
        {
            get { return GetProperty(DepartmentIDProperty); }
            set { SetProperty(DepartmentIDProperty, value); }
        }
        /// <summary>
        /// 员工类型
        /// </summary>
        private static PropertyInfo<Guid> EmployeeTypeProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<Guid>("EmployeeType"));
        [Column]
        public Guid EmployeeType
        {
            get { return GetProperty(EmployeeTypeProperty); }
            set { SetProperty(EmployeeTypeProperty, value); }
        }
        /// <summary>
        /// 操作者
        /// </summary>
        private static PropertyInfo<Guid> AddUserProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<Guid>("AddUser"));
        [Column]
        public Guid AddUser
        {
            get { return GetProperty(AddUserProperty); }
            set { SetProperty(AddUserProperty, value); }
        }
        /// <summary>
        /// 操作时间
        /// </summary>
        private static PropertyInfo<DateTime> AddTimeProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<DateTime>("AddTime"));
        [Column]
        public DateTime AddTime
        {
            get { return GetProperty(AddTimeProperty); }
            set { SetProperty(AddTimeProperty, value); }
        }

        /// <summary>
        /// 部门ID
        /// </summary>
        private static PropertyInfo<Guid> PositionLevelProperty = RegisterProperty(typeof(hrEmployee), new PropertyInfo<Guid>("PositionLevel"));
        [Column]
        public Guid PositionLevel
        {
            get { return GetProperty(PositionLevelProperty); }
            set { SetProperty(PositionLevelProperty, value); }
        }



        #endregion

        #region Validation Rules 验证规则
        //将验证规则与业务对象的属性联系在一起
        protected override void AddBusinessRules()
        {
            //AddRule的第一个参数是委托变量，也就是说是方法的变量
            ValidationRules.AddRule(CommonRules.StringRequired, "CName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("CName", 20));
            ValidationRules.AddRule(CommonRules.StringRequired, "EName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("EName", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "PhotoAddress");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("PhotoAddress", 255));
            ValidationRules.AddRule(CommonRules.StringRequired, "IDCardNO");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("IDCardNO", 18));
            ValidationRules.AddRule(CommonRules.StringRequired, "PassportNO");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("PassportNO", 18));
            ValidationRules.AddRule(CommonRules.StringRequired, "Nationality");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("Nationality", 12));
            ValidationRules.AddRule(CommonRules.StringRequired, "Hometown");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("Hometown", 25));
            ValidationRules.AddRule(CommonRules.StringRequired, "HouseholdRegistration");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("HouseholdRegistration", 25));
            ValidationRules.AddRule(CommonRules.StringRequired, "PersonnelArchivesArea");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("PersonnelArchivesArea", 25));
            ValidationRules.AddRule(CommonRules.StringRequired, "MaritalStatus");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("MaritalStatus", 5));
            ValidationRules.AddRule(CommonRules.StringRequired, "BloodType");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("BloodType", 5));
            ValidationRules.AddRule(CommonRules.StringRequired, "SocialInsuranceNO");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("SocialInsuranceNO", 20));
            ValidationRules.AddRule(CommonRules.StringRequired, "HouseCardNO");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("HouseCardNO", 20));
            ValidationRules.AddRule(CommonRules.StringRequired, "BankCardNO");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("BankCardNO", 20));
            ValidationRules.AddRule(CommonRules.StringRequired, "UrgencyContactPhoneNO");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("UrgencyContactPhoneNO", 16));
            ValidationRules.AddRule(CommonRules.StringRequired, "UrgencyContacRelation");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("UrgencyContacRelation", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "PhoneNo");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("PhoneNo", 16));
            ValidationRules.AddRule(CommonRules.StringRequired, "Email");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("Email", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "Residence");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("Residence", 200));
            ValidationRules.AddRule(CommonRules.StringRequired, "Habits");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("Habits", 200));
            ValidationRules.AddRule(CommonRules.StringRequired, "ResumeSource");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("ResumeSource", 20));
            ValidationRules.AddRule(CommonRules.StringRequired, "TopEducationalLevel");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("TopEducationalLevel", 20));
            ValidationRules.AddRule(CommonRules.StringRequired, "TopDegree");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("TopDegree", 20));
            ValidationRules.AddRule(CommonRules.StringRequired, "SpecialDesc");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("SpecialDesc", 500));
            ValidationRules.AddRule(CommonRules.StringRequired, "EmployeeCode");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("EmployeeCode", 20));
            //base.AddBusinessRules();
        }
        #endregion

        #region Factory Methods 工厂方法

        public hrEmployee() { }

        public static hrEmployee New()
        {
            return DataPortal.Create<hrEmployee>();
        }
        public static hrEmployee Get(Guid ID)
        {
            return DataPortal.Fetch<hrEmployee>(new SingleLazyCriteria<hrEmployee, Guid>(ID, false));
        }
        public static void Delete(Guid ID)
        {
            DataPortal.Delete(ID);
        }

        //public override hrEmployee Save()
        //{
        //return base.Save();
        //}
        #endregion

        #region Data Access 数据访问
        //由于DataPortal_create中没有对数据库的访问，所有标记了Runlocal特性，使得该方法只需在本地运行即可
        //如果代码中有访问数据库的方法，那么就不要用这个特性，使数据门户可以根据情况将此方法的运行选择在应用服务器还是本地
        [RunLocal()]
        protected override void DataPortal_Create()
        {
            //在此调用CheckRules对所有的属性进行验证规则的检查，这样检查只运行一次。
            ValidationRules.CheckRules();
        }


        //可以看到此方法没有标记任何特性
        //此方法要访问数据库所以不能标记本地，由于她没有任何数据库更新操作所以也无需事务性的保护
        //此方法调用结束后会隐含的调用MarkOld（）方法
        private void DataPortal_Fetch(Guid ID)
        {
            //通过连接字符串建立SQL连接对象，Using符号代表，范围释放的意思，SqlConnection对象会在此范围后被释放掉
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(ConnectionStringNames))
            {
                IDb db = DbFactory.Instance.GetDb(ctx.Connection);
                IQuery q = db.Query();
                q.Constrain("ID").Equal(ID);
                var data = db.Select<hrEmployee>(q)[0];
                LoadProperty(IDProperty, data.ID);
                LoadProperty(CNameProperty, data.CName);
                LoadProperty(ENameProperty, data.EName);
                LoadProperty(PhotoAddressProperty, data.PhotoAddress);
                LoadProperty(IDCardNOProperty, data.IDCardNO);
                LoadProperty(PassportNOProperty, data.PassportNO);
                LoadProperty(GenderProperty, data.Gender);
                LoadProperty(NationalityProperty, data.Nationality);
                LoadProperty(HometownProperty, data.Hometown);
                LoadProperty(BirthDateProperty, data.BirthDate);
                LoadProperty(HouseholdRegistrationProperty, data.HouseholdRegistration);
                LoadProperty(PersonnelArchivesAreaProperty, data.PersonnelArchivesArea);
                LoadProperty(HeightProperty, data.Height);
                LoadProperty(WeightProperty, data.Weight);
                LoadProperty(MaritalStatusProperty, data.MaritalStatus);
                LoadProperty(BloodTypeProperty, data.BloodType);
                LoadProperty(JoinDateProperty, data.JoinDate);
                LoadProperty(SocialInsuranceNOProperty, data.SocialInsuranceNO);
                LoadProperty(HouseCardNOProperty, data.HouseCardNO);
                LoadProperty(BankCardNOProperty, data.BankCardNO);
                LoadProperty(UrgencyContactPhoneNOProperty, data.UrgencyContactPhoneNO);
                LoadProperty(UrgencyContacRelationProperty, data.UrgencyContacRelation);
                LoadProperty(PhoneNoProperty, data.PhoneNo);
                LoadProperty(EmailProperty, data.Email);
                LoadProperty(ResidenceProperty, data.Residence);
                LoadProperty(HabitsProperty, data.Habits);
                LoadProperty(ResumeSourceProperty, data.ResumeSource);
                LoadProperty(TopEducationalLevelProperty, data.TopEducationalLevel);
                LoadProperty(TopDegreeProperty, data.TopDegree);
                LoadProperty(SpecialDescProperty, data.SpecialDesc);
                LoadProperty(JoinJobDateProperty, data.JoinJobDate);
                LoadProperty(EmployeeStatusProperty, data.EmployeeStatus);
                LoadProperty(EmployeeCodeProperty, data.EmployeeCode);
                LoadProperty(SalaryProperty, data.Salary);
                LoadProperty(PositionIDProperty, data.PositionID);
                LoadProperty(DepartmentIDProperty, data.DepartmentID);
                LoadProperty(EmployeeTypeProperty, data.EmployeeType);
                LoadProperty(AddUserProperty, data.AddUser);
                LoadProperty(AddTimeProperty, data.AddTime);
                LoadProperty(PositionLevelProperty, data.PositionLevel);
            }
        }

        [Transactional(TransactionalTypes.TransactionScope)]
        protected override void DataPortal_DeleteSelf()
        {
            //依然是调用下面的方法删除的，只是他此时可以获得自己的Id
            DataPortal_Delete(IDProperty);
        }
        #endregion

    }
    [Serializable]
    [Table(Name = "hrEmployee")]
    [iSun.Model.Table(" V_hrEmployee", "ID")]
    public partial class V_hrEmployee : iSun.Entity.EntityBase
    {
        [Column]
        public Guid ID
        {
            get;
            set;
        }

        //[Column]
        //public Guid ID
        //{
        //    get;
        //    set;
        //}

        //[Column]
        //public Guid ID
        //{
        //    get;
        //    set;
        //}

        //[Column]
        //public Guid ID
        //{
        //    get;
        //    set;
        //}
    }
}
